<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/tld/my.tld" prefix="my" %>
<%@ taglib uri="/WEB-INF/tld/user.tld" prefix="user" %>   
  <dd>
    <c:forEach var="c" items="${cities}" varStatus="s">
         <a href="#" id="${c.id}" onclick="citySave('${c.pid}','${c.id}');" >${my:txt(c.name)}</a>
    </c:forEach>
  </dd>
  <script>
  function citySave(provinceId,cityId){
	$.ajax({
		   type: "get",
		   url: "./user.do?src=10201&do=User.address&pid="+provinceId+"&cid="+cityId,
		   success: function(msg){
			  var cityProvinceCity = $('#sec_city>dd>a');
			  var $city = $('#'+cityId);
			  cityProvinceCity.removeClass('hov');
			  $city.addClass('hov');
			  $('#town_ok').html($city.html());
		      $('#city_pop').toggle();
		   },
		  statusCode: {
		    404: function() {
		      alert('page not found');
		    }
		  }
		});
}

  </script>
